<template>
  <div class="home-container">
    <!-- 首屏大图 -->
    <div class="hero-section">
      <div class="hero-content">
        <h1 class="hero-title">智能钢材表面缺陷检测系统</h1>
        <p class="hero-subtitle">基于深度学习的工业视觉检测解决方案</p>
        <a-button type="primary" size="large" class="hero-cta">
          立即体验
          <arrow-right-outlined />
        </a-button>
      </div>
    </div>

    <!-- 核心价值 -->
    <div class="core-values">
      <a-row :gutter="48">
        <a-col :span="8" v-for="(value, index) in values" :key="index">
          <div class="value-card">
            <div class="value-icon">
              <component :is="value.icon" />
            </div>
            <h3>{{ value.title }}</h3>
            <p>{{ value.description }}</p>
          </div>
        </a-col>
      </a-row>
    </div>

    <!-- 技术优势 -->
    <div class="tech-advantages">
      <a-row :gutter="48" align="middle">
        <a-col :span="12">
          <div class="tech-image">
            <img src="@/assets/car.png" alt="技术架构" />
          </div>
        </a-col>
        <a-col :span="12">
          <h2 class="section-title">核心技术优势</h2>
          <a-collapse v-model:activeKey="activeKeys" accordion>
            <a-collapse-panel key="1" header="先进算法模型">
              <p>采用YOLOv8改进模型，结合自研特征增强模块，检测精度达98%</p>
            </a-collapse-panel>
            <a-collapse-panel key="2" header="高效检测性能">
              <p>单图检测时间≤80ms，支持4K高清图像实时处理</p>
            </a-collapse-panel>
            <a-collapse-panel key="3" header="工业级部署">
              <p>支持国产操作系统，通过工业级可靠性认证</p>
            </a-collapse-panel>
          </a-collapse>
        </a-col>
      </a-row>
    </div>

    <!-- 数据统计 -->
    <div class="stats-section">
      <a-row :gutter="48">
        <a-col :span="6" v-for="stat in stats" :key="stat.title">
          <div class="stat-item">
            <div class="stat-value">{{ stat.value }}</div>
            <div class="stat-title">{{ stat.title }}</div>
          </div>
        </a-col>
      </a-row>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue';
import {
  CheckCircleOutlined,
  DashboardOutlined,
  RocketOutlined,
  ArrowRightOutlined
} from '@ant-design/icons-vue';

const activeKeys = ref(['1']);
const values = ref([
  {
    icon: CheckCircleOutlined,
    title: '高精度检测',
    description: '基于深度学习的缺陷识别算法，准确率行业领先'
  },
  {
    icon: DashboardOutlined,
    title: '实时处理',
    description: '毫秒级响应速度，满足生产线实时检测需求'
  },
  {
    icon: RocketOutlined,
    title: '智能分析',
    description: '自动生成检测报告，支持质量追溯分析'
  }
]);

const stats = ref([
  { value: '99.2%', title: '检测准确率' },
  { value: '80ms', title: '平均处理时间' },
  { value: '10万+', title: '日检测量' },
  { value: '20+', title: '支持缺陷类型' }
]);
</script>

<style scoped>
/* 在全局样式添加 */
.value-card {
  transition: transform 0.3s ease;
}

.value-card:hover {
  transform: translateY(-8px);
}

.stat-item {
  animation: fadeInUp 1s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.home-container {
  max-width: 1440px;
  margin: 0 auto;
}

.hero-section {
  background: linear-gradient(135deg, #1a237e 0%, #0d47a1 100%);
  color: white;
  padding: 120px 24px;
  text-align: center;
}

.hero-title {
  font-size: 48px;
  margin-bottom: 24px;
  font-weight: 600;
}

.hero-subtitle {
  font-size: 24px;
  margin-bottom: 40px;
  opacity: 0.9;
}

.hero-cta {
  font-size: 18px;
  padding: 0 40px;
}

.core-values {
  padding: 80px 24px;
  background: #f8f9fa;
}

.value-card {
  padding: 32px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  text-align: center;
}

.value-icon :deep(svg) {
  font-size: 48px;
  color: #1890ff;
  margin-bottom: 24px;
}

.tech-advantages {
  padding: 80px 24px;
}

.tech-image img {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);

}

.section-title {
  font-size: 36px;
  margin-bottom: 40px;
}

.stats-section {
  padding: 80px 24px;
  background: #1a237e;
  color: white;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 48px;
  font-weight: 600;
  margin-bottom: 8px;
}

.stat-title {
  font-size: 18px;
  opacity: 0.8;
}
</style>
